﻿@model WeProjectsModel.Task
<style type="text/css">
    input[type="text"].text-box {
        width: 160px;
    }
</style>

@{
    List<WeProjectsModel.Member> members = ViewBag.projectMember;
    ViewBag.Title = "Create";
}
@Html.Partial("_projectMenu",(int)ViewBag.ProjectID)
<h2>@ViewBag.projectTitle > 建立任务</h2>

    @using (Html.BeginForm()) {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)
    @*<input type="hidden" name="project" value="@Html.ViewContext.RouteData.Values["id"]" />*@
        @Html.HiddenFor(m => m.ProjectID, new { Value = Html.ViewContext.RouteData.Values["id"] })
     <div class="form-horizontal">
         <div class="form-group">
             <label class="col-xs-2 col-md-2 control-label">任务描述</label>
             <div class="col-xs-10 col-md-10">
                 @Html.EditorFor(m => m.Description)
             </div>
         </div>
         <div class="form-group">
             <label class="col-xs-2 col-md-2 control-label">截止日期</label>
             <div class="col-xs-10 col-md-10">
                 @Html.EditorFor(m => m.Due) 必填
             </div>
         </div>
         <div class="form-group">
             <label class="col-xs-2 col-md-2 control-label">参与人员</label>
             <div class="col-xs-10 col-md-10">
                 <div class="marginL-20p">
                     @if(members!=null)
                     { 
                         foreach (var r in members)
                         {
                             <label class="checkbox">
                                 <input type="checkbox" name="members" value="@r.DisplayName" />@r.DisplayName
                             </label>

                         } @ViewBag.memberErr
                     }
                 </div>
             </div>
         </div>
         <div class="form-group">
             <label class="col-xs-2 col-md-2 control-label">说明</label>
             <div class="col-xs-10 col-md-10">
                 @Html.TextAreaFor(m => m.Comment, new { @class="width-50"})
             </div>
         </div>
         <div class="form-group">
             <label class="col-xs-2 col-md-2 control-label"></label>
             <div class="col-xs-10 col-md-10">
                 <input type="submit" name="submit" id="submit" value="提交" class="btn btn-success" />
             </div>
         </div>
     </div>
    @*<table class="gridtable">
        <tr><td>任务描述：</td><td>
            @Html.EditorFor(m=>m.Description)
            </td></tr>
        <tr><td>截止日期：</td><td>
            
            @Html.EditorFor(m=>m.Due)
            @Html.ValidationMessageFor(m=>m.Due)
            </td></tr>
        <tr><td>参与人员：</td><td>
            
            @foreach(var r in members)
            {
                <label class="checkbox">
                    <input type="checkbox" name="members" value="@r.DisplayName" />@r.DisplayName
                </label>
            } @ViewBag.memberErr
            </td></tr>
        <tr><td>说明：</td><td>@Html.TextAreaFor(m => m.Comment)</td></tr>
    </table>*@
    }

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
